package com.cn.stepLock.chain;

import com.cn.stepLock.enums.ChainType;
import com.cn.stepLock.enums.ExecuteStatus;

/**
 * @author Aaron
 * @desc
 * @createTime 2022-02-22 14:07
 * @since
 */
public class SynchronizedProcessChain extends ProcessChain {


    //private AtomicInteger atomicExecuteCount = new AtomicInteger(0);

    public SynchronizedProcessChain() {
        super();
        this.chainType= ChainType.SYNCHRONIZED.getValue();
    }

    @Override
    public void run() {

        while (true){
            Task task = null;
            try {
                task = taskLinkedBlockingQueue.take();
            } catch (InterruptedException e) {
                break;
            }
            task.status = ExecuteStatus.EXTCUTEING.getValue();
            processTask(task);
        }

    }






}
